<!---
    Title:      EPAR1.1 
    Author:     Bruce Frick
    Purpose:    Step5 Access Control Update
--->

<cfset BASE = CreateObject("component", "cfc.base") / >
<cfset statusQueries = CreateObject("component", "cfc.statusQueries") />
<cfset baseQueries = CreateObject("component", "cfc.queries") />

<cfoutput>
<!---HTML header, css links, js links, and page title--->
#BASE.htmlHeader(
    "/jquery/ui-1.8.5/jquery-ui.min.js,/jquery/plugins/scrollTo/jquery.scrollTo-1.4.2-min.js, js/Step5-AccessControlUpdate.js", <!---JS links--->
    "/jquery/ui-1.8.5/themes/cupertino/jquery-ui.css", <!---CSS links--->
    "Step 5:  Facilities - Access Control Update", <!---Page Title--->
    "Status" <!---Active Nav Link--->
)#
<!---HTML header, css links, js links, and page title--->

    
<cfif Session.bolAuth EQ True and (Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR or Session.strAuthType EQ Session.FINANCE)>   
    
    <!---Query objects--->
    <cfset QUERIES = {} />

    <!---Query objects--->        
    
    <h1 class="title">Step 5:  Facilities - Access Control Update</h1>
    <div class="entry">
                    
        <p>
	        Welcome, #Session.arrEmpInfo.FirstName# #Session.arrEmpInfo.LastName#.  
            In this step, provide the Access Control IDs as determined when 
            they are added to Access Control.
        </p>
        <br />
        <br />
        
        <cfform name="frmStep5" method="post" action="api.cfm?api=step5_access_control_update">
            
            <cfset QUERIES.GetStep5Waiting = statusQueries.funcGetSCFStepWaiting(7) />
            
            <cfif QUERIES.GetStep5Waiting.recordcount GT 0>
                
                <table width = 100%>
	                <tr>
	                    <td colspan="10">
	                        <span class="tableHeader">Access Control Creation Report</span>   
	                    </td>
	                    <td align="right" nowrap="nowrap">
	                        <a href="PrintAccessControlReport.cfm" target="_blank">Print Report</a>   
	                    </td>
	                </tr>
	                <tr>
	                    <td width =25%>&nbsp;</td> 
	                    <td><u>##</u></td> 
	                    <td width=5%>&nbsp;</td> 
	                    <td valign="bottom">
	                        <strong><u>Name, Job Title, &amp; Department (Badge)</u></strong>
	                    </td>
	                    <td width =5%>&nbsp;</td> 
	                    <td valign="bottom" nowrap="nowrap">
	                        <strong><u>Access Level(s) Requested</u></strong>
	                    </td>
	                    <td width =5%>&nbsp;</td> 
	                    <td valign="bottom" nowrap="nowrap">
	                        <strong><u>New Access<BR />Control ID</u></strong>
	                    </td>
	                    <td width =5%>&nbsp;</td> 
	                    <td valign="bottom">
	                        <strong><u>Comments</u></strong>
	                    </td>
	                    <td width =35%>&nbsp;</td>  
	                </tr>
                                                                    
	                <cfloop from="1" to="#QUERIES.GetStep5Waiting.RecordCount#" index="i">
                                                                                                                                                        
                       <cfset QUERIES.GetEmpInfo = baseQueries.funcGetEmpInfo( QUERIES.GetStep5Waiting.ID[i] ) />                    
                       <cfset QUERIES.GetPositionInfo = baseQueries.funcGetPositionInfo( QUERIES.GetEmpInfo.PositionID ) />
                       <cfset QUERIES.GetDepts = baseQueries.funcGetDepts( QUERIES.GetEmpInfo.DeptID ) />
                       <cfif QUERIES.GetEmpInfo.BadgeAccessLevelID eq '-- None --'>
                           
                           <cfset QUERIES.GetAccess = baseQueries.funcGetAccess( 0 ) />
                           
                       <cfelse>
                       
                           <cfset QUERIES.GetAccess = baseQueries.funcGetAccess( QUERIES.GetEmpInfo.BadgeAccessLevelID ) />
                           
                       </cfif>

                       <cfif QUERIES.GetEmpInfo.BadgeID NEQ "">
	                      
	                       <cfset QUERIES.GetAccessID = baseQueries.funcGetAccessID( QUERIES.GetEmpInfo.BadgeID ) />
	                       <cfset AccessID = QUERIES.GetAccessID.EmpID>
                            
                       <cfelse>
                       
                           <cfset AccessID = "">
                            
                       </cfif>
	                    
	                <tr>
	                    <td>&nbsp;</td> 
	                    <td valign="top">#i#)</td> 
	                    <td>&nbsp;</td>  
	                    <td nowrap="nowrap" valign="top">
	                        #QUERIES.GetStep5Waiting.Name[i]# (#QUERIES.GetEmpInfo.BadgeID#)<BR />
	                        #QUERIES.GetPositionInfo.PositionCodeDescription#<BR />
	                        #QUERIES.GetDepts.OrganizationDescription#<BR />
	                    </td>
	                    <td>&nbsp;</td> 
	                    <td valign="top">
	                        <cfif QUERIES.GetAccess.RecordCount GT 0>
	                            <cfloop query="QUERIES.GetAccess">
	                                #QUERIES.GetAccess.currentRow#) #QUERIES.GetAccess.Descript#<BR />
	                            </cfloop>
	                        <cfelse>
	                            None
	                        </cfif>
	                    </td> 
	                    <td>&nbsp;</td> 
	                    <td valign="top">
	                        <cfinput type="text" name="AccessID_#QUERIES.GetEmpInfo.ID#_#QUERIES.GetStep5Waiting.ID[i]#" 
                            error_message="The Access Control ID for 
                                '#QUERIES.GetStep5Waiting.Name[i]#' must be numeric.  
                                If there are no levels granted, and<br /> therefore 
                                an Access Control record is not necessary, 
                                please leave this field blank." 
                            size="6" value="#AccessID#">
	                    </td>
	                    <td>&nbsp;</td> 
	                    <td colspan="2" valign="top">
                            <cftextarea name="Comments_#QUERIES.GetEmpInfo.ID#_#QUERIES.GetStep5Waiting.ID[i]#" 
                                style="width:96%"/>
                        </td> 
	                </tr>
	                <tr>
	                    <td>&nbsp;</td> 
	                </tr>
	                </cfloop>
	                
	                <tr>
	                    <td colspan="11" align="right">
	                        <cfinput type="hidden" name="FormIndicator" value="0">
	                        <cfinput type="button" name="AccessLvl" value="Submit">
	                    </td> 
	                </tr>
	            </table>

            <cfelse>
                <span class="error">At the present time, there are not any 
                    employees staged for entry to the Finance system.</span>
            </cfif>
         
        </cfform>        
        
    </div>

<cfelse>
    <cfinclude template="denied.cfm">
</cfif>


<!---HTML footer, closes html and body tags.  Any footer info goes here--->
#BASE.htmlFooter()#
<!---HTML footer, closes html and body tags.  Any footer info goes here--->
</cfoutput>
